(global.webpackJsonp = global.webpackJsonp || []).push([ [ "wjyk_recycle/pages/recycle-center/recycle-center" ], {
    "0fba": function(e, t, n) {
        n.r(t);
        var o, r = n("4502"), c = n("39f5");
        for (o in c) "default" !== o && function(e) {
            n.d(t, e, function() {
                return c[e];
            });
        }(o);
        n("92e7");
        var a = n("f0c5"), r = Object(a.a)(c.default, r.b, r.c, !1, null, null, null, !1, r.a, void 0);
        t.default = r.exports;
    },
    "39f5": function(e, t, n) {
        n.r(t);
        var o, r = n("c718"), c = n.n(r);
        for (o in r) "default" !== o && function(e) {
            n.d(t, e, function() {
                return r[e];
            });
        }(o);
        t.default = c.a;
    },
    4502: function(e, t, n) {
        function o() {
            this.$createElement, this._self._c;
        }
        var r = {
            sunuiPopup: function() {
                return n.e("components/sunui-popup/sunui-popup").then(n.bind(null, "c2fe"));
            },
            sunuiCell: function() {
                return n.e("components/sunui-cell/sunui-cell").then(n.bind(null, "3c51"));
            }
        }, c = [];
        n.d(t, "b", function() {
            return o;
        }), n.d(t, "c", function() {
            return c;
        }), n.d(t, "a", function() {
            return r;
        });
    },
    "92e7": function(e, t, n) {
        var o = n("d712");
        n.n(o).a;
    },
    c718: function(e, n, o) {
        (function(r) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var e, c = (e = o("4795")) && e.__esModule ? e : {
                default: e
            };
            function i(e, t, n, o, r, c, a) {
                try {
                    var s = e[c](a), i = s.value;
                } catch (e) {
                    return n(e), 0;
                }
                s.done ? t(i) : Promise.resolve(i).then(o, r);
            }
            function a(s) {
                return function() {
                    var e = this, a = arguments;
                    return new Promise(function(t, n) {
                        var o = s.apply(e, a);
                        function r(e) {
                            i(o, t, n, r, c, "next", e);
                        }
                        function c(e) {
                            i(o, t, n, r, c, "throw", e);
                        }
                        r(void 0);
                    });
                };
            }
            var t = {
                data: function() {
                    return {
                        pic_url: this.$imgUrl,
                        avatar: this.$imgUrl + "/recycler-img@3x.png",
                        nickName: "回收员昵称",
                        collectorid: "",
                        count: 0,
                        is_online: "",
                        system: {},
                        lng: "",
                        lat: "",
                        checkCount: "",
                        deliverCount: "",
                        robCount: "",
                        unit: "",
                        recyclerInfo: {},
                        cashInfo: {},
                        handleFee: "",
                        money: "",
                        charge: "",
                        recharge_money: "",
                        tempId: ""
                    };
                },
                onShow: function() {
                    this.collectorSet(), this.unit = r.getStorageSync("name"), this.refreshLocation();
                },
                onLoad: function(e) {
                    this.systems(), this.collectorid = e.collectorid, this.avatar = r.getStorageSync("userInfo").avatarUrl, 
                    console.log("options", e);
                },
                onPullDownRefresh: function() {
                    this.systems(), this.collectorSet(), this.refreshLocation(), console.log("refresh"), 
                    setTimeout(function() {
                        r.stopPullDownRefresh();
                    }, 1e3);
                },
                methods: {
                  testLocatin(){
                    let _this = this
                    // 注释getLocation
                    wx.getLocation({
                      type: 'gcj02',
                      isHighAccuracy: true,
                      success (res) {
                        console.info(res,'kkkkkkkkkkkkkkkkkkkkkk')
                        r.showToast({
                          title: "经度:" + res.longitude + "纬度:" + res.latitude,
                          icon: "none"
                        })
                      }
                     })
                  },
                    quicklyRecharge: function() {
                        this.recharge_money ? this.wxPay() : this.$sun.toast("请输入充值金额");
                    },
                    wxPay: function() {
                        var n = this;
                        return a(c.default.mark(function e() {
                            var t;
                            return c.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.pay,
                                        show: !0,
                                        method: "post",
                                        data: {
                                            openid: r.getStorageSync("openid"),
                                            money: n.recharge_money
                                        }
                                    });

                                  case 2:
                                    t = e.sent, console.log("微信支付", t), 0 == t.errno && r.requestPayment({
                                        provider: "wxpay",
                                        timeStamp: t.data.timeStamp,
                                        nonceStr: t.data.nonceStr,
                                        package: t.data.package,
                                        signType: t.data.signType,
                                        paySign: t.data.paySign,
                                        success: function() {
                                            var t = a(c.default.mark(function e(t) {
                                                return c.default.wrap(function(e) {
                                                    for (;;) switch (e.prev = e.next) {
                                                      case 0:
                                                        return e.next = 2, n.collectorRecharge();

                                                      case 2:
                                                        return e.next = 4, n.openSuccess();

                                                      case 4:
                                                        console.log("充值成功", n.recharge_money);

                                                      case 5:
                                                      case "end":
                                                        return e.stop();
                                                    }
                                                }, e);
                                            }));
                                            return function(e) {
                                                return t.apply(this, arguments);
                                            };
                                        }(),
                                        fail: function(e) {
                                            console.log(JSON.stringify(e)), n.$sun.toast("取消支付");
                                        }
                                    });

                                  case 5:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    collectorRecharge: function() {
                        var t = this;
                        return a(c.default.mark(function e() {
                            return c.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, t.$http({
                                        url: t.$api.collectorRecharge,
                                        data: {
                                            collectorid: t.collectorid,
                                            money: t.recharge_money
                                        }
                                    });

                                  case 2:
                                    e.sent, console.log("回收员充值");

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    openDialog: function() {
                        this.$refs.pop.show({
                            style: "background-color:#fff;width:100%;height:auto;overflow-x:auto;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;",
                            anim: "bottom",
                            position: "bottom",
                            topclose: !1,
                            titleStyle: "position: fixed;width: 100%;background: #fff;z-index: 999;border-bottom:1rpx solid #f7f7f7;"
                        });
                    },
                    closeDialog: function() {
                        this.$refs.pop.close();
                    },
                    openRecharge: function() {
                        this.$refs.recharge.show({
                            style: "background-color:#fff;width:546rpx;border-radius:20rpx;"
                        });
                    },
                    closeRecharge: function() {
                        this.$refs.recharge.close();
                    },
                    openTip: function() {
                        this.$refs.tip.show({
                            style: "background-color:#fff;width:546rpx;border-radius:20rpx;overflow: hidden;"
                        });
                    },
                    closeTip: function() {
                        this.$refs.tip.close();
                    },
                    openSuccess: function() {
                        var e = this;
                        this.closeRecharge(), this.$refs.success.show({
                            style: "background-color:#fff;width:546rpx;border-radius:20rpx;"
                        }), setTimeout(function() {
                            e.closeSuccess(), e.collector();
                        }, 1e3);
                    },
                    closeSuccess: function() {
                        this.$refs.success.close();
                    },
                    withdrawal: function(e) {
                        r.navigateTo({
                            url: "/wjyk_recycle/pages/my/withdrawal/withdrawal?type=" + e + "&balance=" + this.recyclerInfo.balance + "&unit=" + this.unit + "&uid=" + this.collectorid
                        });
                    },
                    open: function() {
                        var e, t = this;
                        this.$refs.popcentre.show({
                            style: "background-color:#fff;width:500rpx;border-radius:10rpx;",
                            btns: [ {
                                text: "确认",
                                style: "color:#07C160;font-size:28rpx;",
                                onTap: (e = a(c.default.mark(function e() {
                                    return c.default.wrap(function(e) {
                                        for (;;) switch (e.prev = e.next) {
                                          case 0:
                                            console.log("agree"), t.commissionCashwait();

                                          case 2:
                                          case "end":
                                            return e.stop();
                                        }
                                    }, e);
                                })), function() {
                                    return e.apply(this, arguments);
                                })
                            }, {
                                text: "取消",
                                style: "color:#5F5D5D;font-size:28rpx;",
                                onTap: function() {
                                    console.log("refuse"), t.close();
                                }
                            } ]
                        });
                    },
                    close: function() {
                        this.$refs.popcentre.close();
                    },
                    commissionCashwait: function() {
                        var n = this;
                        return a(c.default.mark(function e() {
                            var t;
                            return c.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return n.close(), e.next = 3, n.$http({
                                        url: n.$api.commissionCashwait,
                                        data: {
                                            uid: n.collectorid,
                                            type: 2,
                                            commission_wait: n.recyclerInfo.balance,
                                            cash_type: 2
                                        }
                                    });

                                  case 3:
                                    0 == (t = e.sent).errno && (n.$sun.toast(t.message), n.collector());

                                  case 5:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    withdraw: function() {
                        var e;
                        0 == this.recyclerInfo.balance || "0.00" == this.recyclerInfo.balance ? this.$sun.toast("暂无" + this.unit + "可提现") : this.recyclerInfo.balance >= Number(this.cashInfo.cash_limit) ? (e = (this.recyclerInfo.balance / this.cashInfo.cash_charge).toFixed(2), 
                        this.handleFee = (e * (this.cashInfo.service_charge / 100)).toFixed(2), this.money = (e - this.handleFee).toFixed(2), 
                        console.log("金钱", e, this.handleFee, this.money), 2 == this.cashInfo.cash_type ? this.open() : r.navigateTo({
                            url: "../withdraw-bank/withdraw-bank?balance=" + this.recyclerInfo.balance + "&money=" + this.money + "&id=" + this.collectorid + "&index=2"
                        })) : r.showToast({
                            title: "未达到提现额度" + this.cashInfo.cash_limit,
                            icon: "none"
                        });
                    },
                    withdrawRecord: function() {
                        r.navigateTo({
                            url: "../withdrawal-record/withdrawal-record?id=" + this.collectorid + "&index=2"
                        });
                    },
                    order: function(e) {
                        r.navigateTo({
                            url: "../order/order?collectorid=" + this.collectorid + "&index=" + e
                        });
                    },
                    selectOrder: function(e) {
                        r.navigateTo({
                            url: "../select-order/select-order?collectorid=" + this.collectorid + "&flag=" + e
                        }), this.closeDialog();
                    },
                    recyclePrice: function() {
                        r.navigateTo({
                            url: "../recycler-price-list/recycler-price-list?county=" + this.recyclerInfo.county
                        });
                    },
                    recyclingOutlets: function() {
                        r.navigateTo({
                            url: "../recycle-outlets/recycle-outlets"
                        });
                    },
                    incomeExpenditure: function(e) {
                        r.navigateTo({
                            url: "../income-expenditure-recycler/income-expenditure-recycler?collectorid=" + this.collectorid + "&index=" + e
                        });
                    },
                    switch1Change: function(o) {
                        var r = this;
                        return a(c.default.mark(function e() {
                            var t, n;
                            return c.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    if (t = 1 == o ? 2 : 1, console.log("点击开启/关闭接单", t), 2 == t) return e.next = 5, 
                                    r.$http({
                                        url: r.$api.collectorOnline,
                                        data: {
                                            collectorid: r.collectorid,
                                            is_online: t
                                        }
                                    });
                                    e.next = 9;
                                    break;

                                  case 5:
                                    0 == (n = e.sent).errno && (r.collector(), console.log("关闭接单", n)), e.next = 13;
                                    break;

                                  case 9:
                                    return e.next = 11, r.$http({
                                        url: r.$api.collectorOnline,
                                        data: {
                                            collectorid: r.collectorid,
                                            is_online: t
                                        }
                                    });

                                  case 11:
                                    0 == (n = e.sent).errno && (r.collector(), r.refreshLocation(), console.log("点击开启接单", n));

                                  case 13:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    refreshLocation: function() {
                        var t, o = this;
                        // 注释getLocation
                        r.getLocation({
                            // type: "wgs84",
                            type: 'gcj02',
                            isHighAccuracy: true,
                            geocode: !0,
                            success: (t = a(c.default.mark(function e(t) {
                                var n;
                                return c.default.wrap(function(e) {
                                    for (;;) switch (e.prev = e.next) {
                                      case 0:
                                        return console.info("刷新位置", t, t.address), e.next = 3, o.$http({
                                            url: o.$api.collectorRefresh,
                                            data: {
                                                collectorid: o.collectorid,
                                                lng: t.longitude,
                                                lat: t.latitude
                                            }
                                        });

                                      case 3:
                                        0 == (n = e.sent).errno && (o.$sun.toast(n.message), o.collector(), console.log("刷新位置111111111", n));

                                      case 5:
                                      case "end":
                                        return e.stop();
                                    }
                                }, e);
                            })), function(e) {
                                return t.apply(this, arguments);
                            })
                        });
                    },
                    orderHall: function() {
                        console.log("抢单大厅", this.lng, this.lat), 1 == this.is_online ? r.navigateTo({
                            url: "../order-hall/order-hall?lng=" + this.lng + "&lat=" + this.lat + "&collectorid=" + this.collectorid
                        }) : this.$sun.toast("请先开启接单");
                    },
                    collector: function() {
                        var n = this;
                        return a(c.default.mark(function e() {
                            var t;
                            return c.default.wrap(function(e) {
                              console.info(e.prev = e.next,'qqqqqqqqqqqqqq')
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.collector,
                                        data: {
                                            collectorid: n.collectorid
                                        }
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && (n.nickName = t.data.name, n.count = t.data.count, n.is_online = t.data.is_online, 
                                    n.deliverCount = t.data.deliverCount, n.checkCount = t.data.checkCount, n.robCount = t.data.robCount, 
                                    n.recyclerInfo = t.data, console.log("回收员中心", t), n.lat || (n.lng = t.data.lng, 
                                    n.lat = t.data.lat));

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    commissionSet: function() {
                        var n = this;
                        return a(c.default.mark(function e() {
                            var t;
                            return c.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.commissionSet,
                                        data: {
                                            type: 2
                                        }
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && (n.cashInfo = t.data, console.log("提现设置", t));

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    collectorSet: function() {
                        var n = this;
                        return a(c.default.mark(function e() {
                            var t;
                            return c.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.collectorSet
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && (n.charge = t.data.charge, console.log("回收员设置", t, t.data.charge));

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    systems: function() {
                        var n = this;
                        return a(c.default.mark(function e() {
                            var t;
                            return c.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.system
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && (console.log("系统设置", t), n.tempId = t.data.userTemplate, 
                                    n.system = t.data, n.acceptMessage());

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    acceptMessage: function() {
                        var t, n = this;
                        console.log("订阅消息", this.tempId), r.requestSubscribeMessage({
                            tmplIds: [ this.tempId ],
                            success: (t = a(c.default.mark(function e(t) {
                                return c.default.wrap(function(e) {
                                    for (;;) switch (e.prev = e.next) {
                                      case 0:
                                        console.log("data", t, n.tempId, [ n.tempId ]), "accept" == t[n.tempId] ? console.log("授权成功", t) : wx.showModal({
                                            title: "温馨提示",
                                            content: "您已拒绝授权，将无法在微信中收到通知！",
                                            showCancel: !1,
                                            success: function(e) {
                                                e.confirm && console.log("拒绝授权", t);
                                            }
                                        });

                                      case 2:
                                      case "end":
                                        return e.stop();
                                    }
                                }, e);
                            })), function(e) {
                                return t.apply(this, arguments);
                            }),
                            fail: function(e) {
                                console.log("失败", e);
                            },
                            complete: function(e) {
                                console.log("完成", e);
                            }
                        });
                    }
                }
            };
            n.default = t;
        }).call(this, o("543d").default);
    },
    d712: function(e, t, n) {},
    e7f2: function(e, t, n) {
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            n("8163"), t(n("66fd")), e(t(n("0fba")).default);
        }).call(this, n("543d").createPage);
    }
}, [ [ "e7f2", "common/runtime", "common/vendor" ] ] ]);